/*
 * @Date: 2022-11-29 12:52:05
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-11-29 13:23:29
 * @FilePath: \vue-admin-ts\src\views\main\product\goods\options.ts
 * @Description: 商品配置
 */
import { FormOptions } from "@/components/Form/type/type";
import { TableOptions } from "@/components/Table/type/type";

export const goodsFormItems: FormOptions[] = [
  {
    type: "input",
    label: "原价：",
    prop: "oldPrice",
    placeholder: "请输入原价",
  },
  {
    type: "input",
    label: "真实姓名：",
    prop: "realname",
    placeholder: "请输入真实姓名",
  },
  {
    type: "input",
    label: "电话号码：",
    prop: "cellphone",
    placeholder: "请输入电话号码",
  },
  {
    type: "select",
    label: "用户状态：",
    prop: "enable",
    placeholder: "请选择用户状态",
    attrs: {
      clearable: true,
      style: {
        width: "100%",
      },
    },
    children: [
      {
        type: "option",
        prop: "cellphone",
        value: 1,
        label: "启用",
      },
      {
        type: "option",
        prop: "cellphone",
        value: 0,
        label: "禁用",
      },
    ],
  },
  {
    type: "date-picker",
    label: "创建时间：",
    prop: "createAt",
    attrs: {
      type: "daterange",
      startPlaceholder: "开始时间",
      endPlaceholder: "结束时间",
    },
  },
];

export const goodsTableOptions: TableOptions[] = [
  {
    prop: "desc",
    label: "商品描述",
    width: "150",
    itemAttrs: {
      showOverflowTooltip: true,
    },
  },
  {
    prop: "oldPrice",
    label: "原价",
  },
  {
    prop: "newPrice",
    label: "现价",
  },
  {
    prop: "imgUrl",
    label: "商品图片",
    slot: "image",
  },
  {
    prop: "createAt",
    label: "创建时间",
    align: "center",
    slot: "createAt",
  },
  {
    prop: "updateAt",
    label: "更新时间",
    align: "center",
    slot: "updateAt",
  },
  {
    prop: "status",
    label: "状态",
    align: "center",
    slot: "enable",
    width: "100",
  },
  {
    prop: "operation",
    slot: "operation",
    label: "操作",
    align: "center",
    action: true,
  },
];
